import request from '@/utils/request'
export default {
    //1 根据传入的课程id查出所有的章节，以及章节下面的小节
    getAllChapterVideo(courseId) {
        return request({
            url: `eduservice/chapter/getChapterVideo/${courseId}`,
            method: 'get',
            
          })
    },
    //添加章节
    addChapter(eduChapter) {
        return request({
            url: `eduservice/chapter/addChapter`,
            method: 'post',
            data: eduChapter
            
          })
    },
    //根据章节id查询
    getChapterInfo(chapterId) {
        return request({
            url: `eduservice/chapter/getChapterInfo/${chapterId}`,
            method: 'get',
            
          })
    },
    //修改章节
    updateChapter(eduChapter) {
        return request({
            url: `eduservice/chapter/updateChapter`,
            method: 'post',
            data: eduChapter
            
          })
    },
    //根据章节id删除
    deleteChapter(chapterId) {
        return request({
            url: `eduservice/chapter/deleteChapter/${chapterId}`,
            method: 'delete',
            
          })
    },

    //============小节管理==============

    //添加小节
    addEduVideo(eduVideo) {
        return request({
            url: `/eduservice/eduvideo/addEduVideo`,
            method: 'post',
            data: eduVideo
            
          })
    },

    //修改小节
    updateEduVideo(eduVideo) {
        return request({
            url: `eduservice/eduvideo/updateEduVideo`,
            method: 'put',
            data: eduVideo
            
          })
    },
    //根据小节id删除
    deleteEduVideoById(EduVideoId) {
        return request({
            url: `/eduservice/eduvideo/${EduVideoId}`,
            method: 'delete',
            
          })
    },
    //根据小节id查询
    getEduVideoById(EduVideoId) {
        return request({
            url: `/eduservice/eduvideo/${EduVideoId}`,
            method: 'get',
            
          })
    },
    //根据上传的视频id删除阿里云视频
    deleteAliYunVideoById(videoId) {
        return request({
            url: `/eduvod/video/${videoId}`,
            method: 'delete',
            
          })
    },

}